package day04;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/11
 */
public class Max {
    public static void main(String[] args) {

        int[] arr = new int[5];
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入5个整数：");

        int i = 0;
        while ((i<5)&&sc.hasNextInt()){
            arr[i] = sc.nextInt();
            i++;
        }

        System.out.println("数组为：");
        for (int j : arr) {
            System.out.print(j+" ");
        }

        System.out.println();
        Arrays.sort(arr);
        System.out.println("最大值为："+arr[arr.length-1]);

    }
}
